package com.example.mapper;

import com.example.entity.Stayinfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface StayinfoMapper {
    @Select("SELECT * FROM stayinfo")
    List<Stayinfo> finAll();
    @Select("SELECT * FROM stayinfo where stu_num=#{stu_num}")
    List<Stayinfo> findAllByid(String stu_num);

    int update(Stayinfo stayinfo);

    int insert(Stayinfo stayinfo);

    @Delete("DELETE FROM stayinfo WHERE stu_num = #{stu_num}")
    Integer deleteBy(@Param("stu_num") String stu_num);

    List<Stayinfo> selectPage(Integer pageNum, Integer pageSize, String name);

    Integer selectTotal(String name);

    List<Stayinfo> selectPage1(Integer pageNum, Integer pageSize, String name,String floor_num);

    Integer selectTotal1(String name,String floor_num);
}
